package com.lulin.common.constant;

/**
 * 订单的相关变量
 *
 * @author lulin
 * @date 2022/12/15 9:02
 */
public class OrderConstant {
    /**
     * 订单放重复提交的token的前缀
     */
    public static final String ORDER_TOKEN_PREFIX = "order:token:";
    /**
     * rocketMQ的订单主题topic
     */
    public static final String ROCKETMQ_ORDER_TOPIC = "order-topic";

    /**
     * 订单状态：
     * 【0：代付款  1：待发货    2：已发货   3：已完成   4：已关闭   5：无效订单  】
     */
    //订单状态的枚举类
    public enum OrderStatusEnum {
        FOR_THE_PAYMENT(0, "待支付"),
        TO_SEND_GOODS(1, "待发货"),
        HAS_BEEN_SHIPPED(2, "已发货"),
        HAS_BEEN_COMPLETED(3, "已完成"),
        CLOSE(4, "已关闭"),
        INVAILD_ORDERS(5, "无效订单");

        private int code;
        private String msg;

        OrderStatusEnum(int code, String msg) {
            this.code = code;
            this.msg = msg;
        }

        public int getCode() {
            return code;
        }

        public String getMsg() {
            return msg;
        }
    }
}
